Tokens in Java
Tokens are the smallest or atomic elements of a language. A Java program can be written using tokens, white spaces and the syntax of the language.
Java has the following tokens:
1. Keywords
2. Identifiers
3. Literal
4. Operators
5. Separator
White space is defined as a blank space, tab, carriage return, form feed, and newline. The compiler ignores the white space.
White spaces are used to separate tokens. For example, white space is required between two adjacent tokens like an identifier and an operator for better readability.